Method carried out in system including active stylus and sensor controller, sensor controller, and active stylus

ABSTRACT

A method carried out in a system having an active stylus and a sensor controller includes establishing frame synchronization between the controller and the stylus, selecting a first variable-length command from among multiple variable-length commands each including data of a variable number of bits, transmitting the first command in a first portion of a frame using an uplink signal having a variable time length that depends on a number of bits of the first command, receiving the uplink signal having the variable time length, detecting the first command by decoding the uplink signal up to a tail of the uplink signal, and transmitting a downlink signal that depends on the first command in a second portion of the first frame that is different from the first portion of the first frame.

BACKGROUND Technical Field

The present disclosure relates to a method carried out in a systemincluding an active stylus and a sensor controller, a sensor controller,and an active stylus.

Background Art

Some touch-type input systems are arranged such that a stylus can sendsignals to a sensor controller. An example of such input system isdisclosed in WO2015/111159.

In recent years, there have been seen input systems in which not only astylus sends signals to a sensor controller, but also the sensorcontroller sends signals to the stylus. The former signals willhereinafter be referred to as “downlink signal,” and the latter signalsas “uplink signal.” Those input systems that are capable ofbidirectional communication can use communication resources efficientlybecause the stylus can be operated by a command sent from the sensorcontroller to the stylus.

However, providing bidirectional communication is performed ontime-division principles, some of the communication resources areoccupied by uplink signals. As a result, the communication time that canbe used to send downlink signals is reduced. Consequently, the inputsystems remain to be improved.

BRIEF SUMMARY

An object of the present disclosure is to reduce the proportion ofcommunication resources occupied by uplink signals sent from a sensorcontroller to a stylus, i.e., an uplink signal occupancy ratio, amongthe communication resources that can be used to send and receive signalsbetween the stylus and the sensor controller.

According to a first aspect of the present disclosure, there is provideda method carried out in a system including an active stylus and a sensorcontroller, including establishing, by the stylus and the sensorcontroller, frame synchronization between the sensor controller and theactive stylus, selecting, by the sensor controller, a firstvariable-length command from a plurality of variable-length commands,each of the variable-length commands including data of a variable numberof bits, transmitting, by the sensor controller, the selected firstvariable-length command using an uplink signal having a variable timelength that depends on a number of bits of the first variable-lengthcommand, receiving, by the active stylus, the uplink signal having thevariable time length, detecting, by the active stylus, the firstvariable-length command decoding the uplink signal having the variabletime length up to a tail of the uplink signal having the variable timelength, and transmitting, by the active stylus, downlink signal thatdepends on the received first variable-length command, the downlinksignal being transmitted in a second portion the first frame that isdifferent from the first portion of the first frame.

According to the first aspect of the present disclosure, there isprovided a sensor controller including a transmitter which, inoperation, establishes frame synchronization with an active stylus,selects a first variable-length command from a plurality ofvariable-length commands after establishing frame synchronization withthe active stylus, each of the variable-length commands including dataof a variable number of bits, and transmits the selected firstvariable-length command in a first portion of a first frame using anuplink signal having a time length that depends on a number of bits ofthe first variable-length command, and a receiver which, in operation,receives a downlink signal from the active stylus in a second portion ofthe first frame that is different from the first portion of the firstframe, the downlink signal depending on the first variable-lengthcommand.

According to the first aspect of the present disclosure, there isprovided an active stylus including a receiver which, in operation,establishes frame synchronization with a sensor controller, receives afirst variable-length command by detecting an uplink signal transmittedby the sensor controller in a first portion of a first frame, the firstvariable-length command being selected from a plurality ofvariable-length commands, each of the variable-length commands includingdata of a variable number of bits, and a transmitter which, inoperation, transmits a downlink signal that depends on the receivedfirst variable-length command in a second portion of the first framethat is different from the first portion of the first frame.

According to a second aspect of the present disclosure, there isprovided a method carried out in a system including an active stylus anda sensor controller, including a transmitting step in which the secondcontroller sends an uplink signal including a first partial signal and asecond partial signal, and a receiving step in which the active stylusreceives the uplink signal, in which, in the transmitting step, thesensor controller sends the first partial signal by way of directspreading using a first spread code and sends the second partial signalby way of direct spreading using a second spread code which is a codedifferent from the first spread code and which has an identical chiptime length to the first spread code, and in the receiving step, theactive stylus is synchronized with the uplink signal by detecting thefirst partial signal using the first spread code and thereafter detectsthe second partial signal using the second spread code.

According to the second aspect of the present disclosure, there isprovided a system comprising a sensor controller that includes atransmitter which, in operation, transmits an uplink signal including afirst partial signal and a second partial signal, in which thetransmitter transmits the first partial signal by direct spreading usinga first spread code and transmits the second partial signal by directspreading using a second spread code, the second spreading code beingdifferent from the first spread code and having a chip time length thatis identical to a chip time length of the first spread code; and anactive stylus that includes a receiver which, in operation, receives theuplink signal including the first partial signal and the second partialsignal, in which the receiver is synchronized with the uplink signal bydetecting the first partial signal using the first spread code andsubsequently detecting the second partial signal using the second spreadcode.

According to the first aspect of the present disclosure, since the timelength of the uplink signal sent by the sensor controller is adjusteddepending on the number of bits of a variable-length command to be sent,it is possible to reduce an uplink signal occupancy ratio.

According to the second aspect of the present disclosure, because thecode length of the second spread code used after synchronization can beshorter than the code length of the first spread code used forsynchronization, it is possible to further reduce the uplink signaloccupancy ratio.

The above and other objects, features, and advantages of the presentdisclosure will become more apparent from the following description whentaken in conjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a view illustrating the makeup of a system according to afirst embodiment of the present disclosure;

FIG. 2 is a diagram illustrating the makeup of a sensor and a sensorcontroller illustrated in FIG. 1;

FIGS. 3A through 3D are diagrams illustrating variable-length commandsaccording to the first embodiment of the present disclosure;

FIG. 4 is a block diagram illustrating functional blocks of a stylusillustrated in

FIG. 1;

FIG. 5 is a diagram illustrating a method for sending and receiving avariable-length command illustrated in FIGS. 3A through 3D;

FIG. 6 is a flowchart illustrating operation of the sensor controlleraccording to the first embodiment of the present disclosure;

FIG. 7 is a flowchart illustrating operation of the stylus according tothe first embodiment of the present disclosure;

FIGS. 8A through 8C are diagrams illustrating advantages of the firstembodiment of the present disclosure;

FIGS. 9A and 9B are diagrams illustrating a variable-length commandaccording to a first modification of the first embodiment of the presentdisclosure;

FIGS. 10A and 10B are diagrams illustrating a variable-length commandaccording to a second modification of the first embodiment of thepresent disclosure;

FIGS. 11A and 11B are diagrams illustrating a variable-length commandaccording to a third modification of the first embodiment of the presentdisclosure;

FIGS. 12A and 12B are diagrams illustrating a method for sending andreceiving variable-length commands according to the third modificationof the first embodiment of the present disclosure;

FIG. 13 is a flowchart illustrating operation of a sensor controlleraccording to the third modification of the first embodiment of thepresent disclosure;

FIG. 14 is a flowchart illustrating operation of a stylus according tothe third modification of the first embodiment of the presentdisclosure;

FIG. 15 is a diagram illustrating a method for sending and receiving avariable-length command according to a second embodiment of the presentdisclosure;

FIG. 16 is a flowchart illustrating operation of a stylus according tothe second embodiment of the present disclosure;

FIG. 17 is a block diagram illustrating functional blocks of a stylusaccording to a third embodiment of the present disclosure;

FIGS. 18A and 18B are diagrams illustrating a spread code illustrated inFIG. 15;

FIG. 19 is a flowchart illustrating operation of a stylus according tothe third embodiment of the present disclosure;

FIG. 20 is a flowchart illustrating operation of the stylus according tothe third embodiment of the present disclosure;

FIG. 21 is a diagram illustrating a method for sending and receiving avariable-length command according to the third embodiment of the presentdisclosure; and

FIGS. 22A and 22B are diagrams illustrating a method for sending andreceiving variable-length commands according to a modification of thethird embodiment of the present disclosure.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Preferred embodiments of the present disclosure will hereinafter bedescribed in detail with reference to the accompanying drawings.

FIG. 1 is a view illustrating the makeup of a system 1 according to afirst embodiment of the present disclosure. As illustrated in FIG. 1,the system 1 includes a stylus 2 and an electronic device 3. Theelectronic device 3 is either a digitizer connected to a separate PC ora tablet PC having a display device, for example. The electronic device3 is arranged to enter line drawings by moving the stylus 2 or a finger,not illustrated, on a panel surface 3 a.

The stylus 2 is an active stylus of the electrostatic capacitance type.As illustrated in FIG. 1, the stylus 2 has a core 20, an electrode 21, apen pressure detection sensor 23, a signal processor 24, and a powersupply 25.

The core 20 is a rod-shaped member disposed such that its longitudinaldirection is aligned with a penholder direction of the stylus 2. Thecore 20 has a tip end portion 20 a whose surface is coated with anelectrically conductive material, functioning as the electrode 21. Thecore 20 has a rear end portion held against the pen pressure detectionsensor 23. When the tip end portion 20 a of the core 20 is pressedagainst the panel surface 3 a or the like, the pen pressure detectionsensor 23 detects a pen pressure level commensurate with the pressureapplied to the tip end portion 20 a, i.e., a pen pressure applied to thecore 20. According to a specific example, the pen pressure detectionsensor 23 includes a variable-capacitance module whose electrostaticcapacitance varies depending on the pen pressure applied thereto.

The electrode 21 is electrically connected to the signal processor 24 byinterconnects. When the signal processor 24 supplies a downlink signalDS to the electrode 21, the electrode 21 induces electric chargescommensurate with the supplied downlink signal DS. The induced electriccharges cause changes in an electrostatic capacitance in a sensor 30, tobe described later, and a sensor controller 31, to be described later,receives the downlink signal DS by detecting the changes. When an uplinksignal US sent from the sensor controller 31 via the sensor 30 arrivesat the electrode 21, the electrode 21 induces electric chargescommensurate with the uplink signal US that has arrived. The signalprocessor 24 receives the uplink signal US by detecting the electriccharges induced by the electrode 21.

The signal processor 24 has a function to receive an uplink signal USsent from the sensor controller 31 via the electrode 21 and a functionto generate a downlink signal DS according to a command, to be describedlater, included in the received uplink signal US and send the downlinksignal DS to the sensor controller 31 via the electrode 21.

The power supply 25 serves to supply operating electric power (DCvoltage) to the signal processor 24, and includes a cylindrical AAAAcell, for example.

The electronic device 3 has a sensor 30 that provides the panel surface3 a, a sensor controller 31, and a host processor 32 that controls thefunctions of components of the electronic device 3 that include thesensor 3 and the sensor controller 31.

The sensor controller 31 has a function to send an uplink signal US tothe stylus 2 via the sensor 30. An uplink signal US is a signal having avariable length, i.e., a variable time length, where the time lengthdiffers depending on control content. The uplink signal US includes acontrol command, i.e., a variable-length command vCMD to be describedlater, whose variable length represents control content for the stylus2. The sensor controller 31 also has a function to receive a downlinksignal DS sent from the stylus 2 via the sensor 30.

FIG. 2 is a diagram illustrating the makeup of the sensor 30 and thesensor controller 31 illustrated in FIG. 1. As illustrated in FIG. 2,the sensor 30 has a matrix of linear electrodes 30X and linearelectrodes 30Y and is capacitively coupled to the electrode 21 (seeFIG. 1) of the stylus 2 by the linear electrodes 30X, 30Y. The sensorcontroller 31 has a transmitter 60, a selector 40, a receiver 50, and anMCU 80.

The MCU 80 is a processor having functions to control the components ofthe sensor controller 31. Specifically, the MCU 80 has a function tosupply the transmitter 60 with data to be sent as an uplink signal US(hereinafter referred to as “transmission data”) and a command end valueEoC indicative of the end of the transmission data, a function toreceive a downlink signal DS output from the receiver 50, derive theposition (x, y) of the stylus 2 based on the received downlink signalDS, acquire data Res sent from the stylus 2, and supply the acquireddata Res to the host processor 32, and a function to control theselector 40 to switch between the sending of an uplink signal US and thereception of a downlink signal DS and select linear electrodes used tosend an uplink signal US and linear electrodes used to receive adownlink signal DS.

The transmission data that are supplied from the MCU 80 to thetransmitter 60 include a preamble Pre and a variable-length command vCMDfollowing the preamble Pre. The preamble Pre is made up of known data,e.g., a bit string “00” having a 2-bit length, shared with the stylus 2.The variable-length command vCMD represents arbitrary data having avariable length which indicates control content for the stylus 2. TheMCU 80 selects one, i.e., a first variable-length command, of aplurality of variable-length commands each of which can include datarepresented by a variable number of bits.

The MCU 80 sends uplink signals US and receives downlink signals DS inrespective frames. In each frame, the MCU 80 outputs a bit string as apreamble Pre at the leading end of the frame to the transmitter 60, thenoutputs a bit string as a variable-length command vCMD to thetransmitter 60, and thereafter receives a downlink signal DS in the restof the frame. Consequently, the sensor controller 31 periodically sendspreambles Pre accompanying variable-length commands vCMD repeatedly tothe stylus 2, and, on all such occasions, the stylus 2 sends downlinksignals DS depending on the content of the variable-length commands vCMDto the sensor controller 31. The preambles Pre that are sent in therespective frames serve to supply a frame reference time from the sensorcontroller 31 to the stylus 2.

FIGS. 3A through 3D are diagrams illustrating variable-length commandsvCMD according to the present embodiment. According to the presentembodiment, a variable-length command vCMD to be sent is selected fromfour kinds of variable-length commands vCMD, whose sizes are representedby N bytes, 2N bytes, 3N bytes, and 4N bytes, respectively, illustratedin FIGS. 3A through 3D. These variable-length commands vCMD haverespective length fields, illustrated hatched, indicative of their sizesat common given positions. In the example illustrated in FIGS. 3Athrough 3D, each of the length fields has a bit length of 2. The lengthfields have respective four values “00,” “01,” “10,” “11” that can beexpressed by 2 bits, associated respectively with N bytes, 2N bytes, 3Nbytes, and 4N bytes. Stated otherwise, based on a selectedvariable-length command vCMD to be sent, the MCU 80 determines thenumber of bits of the variable-length command vCMD, and changes thevalue of the length field in the variable-length command vCMD based onthe determined number of bits. The stylus decodes the value of thelength field in the variable-length command vCMD received thereby, anddetermines a time during which to continue receiving the variable-lengthcommand vCMD depending on the decoded value. It is thus possible toappropriately decode the variable-length command vCMD in its entirety.

The sizes of variable-length commands vCMD may not necessarily be offour kinds, but may be of two or more kinds. The bit length of a lengthfield may be suitably adjusted depending on the number of alternativesizes of variable-length commands vCMD.

Referring back to FIG. 2, the transmitter 60 is a circuit that generatesan uplink signal US based on transmission data supplied from the MCU 80and outputting the generated uplink signal US to the selector 40. Thetransmitter 60 includes a direct spreader 63, a spread code holder 64,and a transmission guard circuit 65. A modulator that performs phaseshift keying (PSK) modulation, i.e., Manchester encoding, or the likemay be placed in a stage following the direct spreader 63.

The spread code holder 64 has a function to hold and output one or morespread codes C1, C2, C3.

The spread code C1 is, for example, a pseudo-noise (PN) code“0111000010100110” of 16 chips (bits) illustrated in an upper row inFIG. 18A, to be described later. However, the spread code C1 is notlimited to a PN code, but may be a code string having autocorrelationcharacteristics.

The spread code C2 is a PN code whose code length is shorter than thespread code C1, and is, for example, a PN code “0110001” of seven chips(see times t3 through t5 in FIG. 15). However, the spread code C2 is notlimited to a PN code, but may be a code string having a property thatincreases the noise resistance of a bit string to be sent, e.g., a codestring having autocorrelation characteristics. The time length ofindividual chips, i.e., a chip time length, of the spread code C2 may bethe same as the chip time length of the spread code C1. Furthermore, aplurality of spread codes C2 may make up a spread code C1, e.g., aplurality of spread codes C2 may be joined together into a spread codeC1. According to a specific example, a 21-bit code generated by joiningthree 7-chip spread codes C2 may be used as a spread code C1 thatincreases the detection level of a peak value, making it possible todetermine, with higher accuracy, a timing of synchronization with anuplink signal itself, and also making it possible to simply the makeupof a correlation processor 71 b, to be described later, in the stylus 2.

The spread code C3 refers to a generic term for spread code variationsobtained by cyclically shifting a spread code C1 by predetermined chipsor reversing the polarity of such cyclically shifted spread codes. Forexample, spread codes C31, C32, C33, C31 r, C32 r, C33 r illustrated inFIG. 18B come under the spread code C3. The spread code C31 is a spreadcode C1 itself. The spread code C32 is a spread code obtained byshifting the spread code C31 by five bits. The spread code C33 is aspread code obtained by shifting the spread code C32 by five bits. Thespread code C31 r is a spread code obtained by reversing the spread codeC31. The spread code C32 r is a spread code obtained by reversing thespread code C32. The spread code C33 r is a spread code obtained byreversing the spread code C33.

Though the spread codes C1, C2, C3 have been described above, only thespread code C1 is used according to the present embodiment. Therefore,it is enough for the spread code holder 64 to store at least the spreadcode C1. The spread codes C2, C3 will be described in greater detail insecond and third embodiments, respectively.

The direct spreader 63 has a function to generate an uplink signal USaccording to a direct spreading process, e.g., a direct spectrumspreading process, using the spread code output from the spread codeholder 64. An uplink signal US generated by the process performed by thedirect spreader 63 is made up of a series of spread codes depending onthe values of transmission data, as illustrated in FIG. 5 to bedescribed later. The uplink signal US has a time length depending on thenumber of bits of a variable-length command vCMD included therein.

Specific makeups of the direct spreader 63 include a logic circuit thatexclusive-ORs the bit values of transmission data and the spread code,and a circuit that holds bit values of spread codes in a memory andoutputting spread codes corresponding to bit values of the transmissiondata from the memory. Since the spread code C1 is used in the presentembodiment, the direct spreader 63 outputs a spread code C1corresponding to each bit value “0” of the transmission data and outputsa code (hereinafter referred to as “spread code C1 r”), which is areversal of the spread code C1, corresponding to each bit value “1” ofthe transmission data.

The transmission guard circuit 65 has a function to stop outputting anuplink signal US based on a command end value EoC supplied from the MCU80.

The selector 40 is a switch that switches between a transmission periodin which the sensor 30 sends an uplink signal US and a reception periodin which the sensor 30 receives a downlink signal DS, under the controlof the MCU 80. The selector 40 includes switches 44 x, 44 y andconductor selecting circuits 41 x, 41 y. The switch 44 x operates toconnect an output terminal of the transmitter 60 to an input terminal ofthe conductor selecting circuit 41 x during the transmission period tosend an uplink signal US, and to connect an output terminal of theconductor selecting circuit 41 x to an input terminal of the receiver 50during the reception period to receive a downlink signal DS, based on acontrol signal sTRx supplied from the MCU 80. The switch 44 y operatesto connect the output terminal of the transmitter 60 to an inputterminal of the conductor selecting circuit 41 y during the transmissionperiod to send an uplink signal US and to connect an output terminal ofthe conductor selecting circuit 41 y to the input terminal of thereceiver 50 during the reception period to receive a downlink signal DS,based on a control signal sTRy supplied from the MCU 80. The conductorselecting circuit 41 x operates to select one or more, at a time, of thelinear electrodes 30X and connect the selected linear electrode orelectrodes 30X to the switch 44 x, based on a control signal selXsupplied from the MCU 80. The conductor selecting circuit 41 y operatesto select one or more, at a time, of the linear electrodes 30Y andconnect the selected linear electrode or electrodes 30Y to the switch 44y, based on a control signal selY supplied from the MCU 80.

The receiver 50 is a circuit that detects or receives a downlink signalDS sent from the stylus 2. The receiver 50 includes an amplifyingcircuit, a detecting circuit, an analog-to-digital (AD) converter, etc.,not illustrated. The receiver 50 supplies a detected or receiverdownlink signal DS to the MCU 80.

FIG. 4 is a block diagram illustrating functional blocks of the stylus2. As illustrated in FIG. 4, the stylus 2 includes a switch circuit SW,a receiver 71 (receiving circuit), a spread code storage 72, atransmitter 75 (transmitting circuit), and a controller 90 (controlcircuit).

The switch circuit SW is a switch that switches between a reception modeR and a transmission mode T based on a control signal SWC from thecontroller 90. In the reception mode R, the switch circuit SW connectsthe electrode 21 to the receiver 71. In the transmission mode T, theswitch circuit SW connects the electrode 21 to the transmitter 75. Theswitch circuit SW may alternatively have an electrode that receives anuplink signal US and an electrode that sends a downlink signal DS,separately from each other.

The spread code storage 72 is a storage device that stores the spreadcodes C1, C2, C3 referred to above. However, since only the spread codeC1 is used in the present embodiment, the spread code storage 72 may notstore the spread codes C2, C3.

The receiver 71 includes a waveform regenerator 71 a and a correlationprocessor 71 b. The waveform regenerator 71 a shapes the levels ofelectric charges (voltages) induced in the electrode 21 into a binarystring having positive and negative polarity values, which correspondsto the chip string of a spread code, and outputs the binary string. Thecorrelation processor 71 b stores the binary string having positive andnegative polarity values output from the waveform regenerator 71 a in aregister array, and performs a correlation operation on the binarystring with respect to the spread code C1 stored in the spread codestorage 72 while successively shifting the binary string with a blockclock signal CLK, not illustrated.

The receiver 71 receives a variable-length command vCMD by detecting anuplink signal US and its time length and continuing decoding the uplinksignal US up to the tail of the detected time length. More specifically,the receiver 71 first detects a preamble Pre based on the correlationoperation performed by the correlation processor 71 b. The receiver 71acquires a frame reference time by detecting the preamble Pre, anddetects a variable-length command vCMD according to the acquired framereference time. In order to detect the variable-length command vCMD, thereceiver 71 detects the time length of the uplink signal US from theinformation, i.e., the length field in the present embodiment, includedin the uplink signal US, and continues decoding the uplink signal US upto the tail of the detected time length. After having detected thevariable-length command vCMD in its entirety, the receiver 71 suppliesthe detected variable-length command vCMD to the controller 90.

FIG. 5 is a diagram illustrating a method for sending and receiving avariable-length command vCMD according to the present embodiment. FIG. 5illustrates a variable-length command vCMD where N illustrated in FIGS.3A through 3D is 5, i.e., a variable-length command vCMD that is of 5bytes in case the 2-bit length field is “00.” FIG. 5 illustrates anexample where the length field is positioned at second and third bits ofthe variable-length command vCMD.

As illustrated in FIG. 5, the result of the correlation operationperformed by the correlation processor 71 b indicates a positive peakvalue at the timing when each of a spread code representing “0,” i.e., aspread code C1, has been received in its entirety and a negative peakvalue at the timing when each of a spread code representing “1,” i.e., aspread code Clr, has been received in its entirety. The receiver 71detects that “0” or “1” has been received by confirming the occurrenceof a peak value and its negative or positive value. The receiver 71 thendetermines the bit length of a variable-length command vCMD byconfirming the bit value detected as the length field, i.e., “00” in theexample illustrated in FIG. 5, acquires a bit string commensurate withthe determined bit length as a variable-length command vCMD, andsupplies the acquired variable-length command vCMD to the controller 90.When the controller 90 is supplied with the variable-length commandvCMD, the controller 90 executes the supplied variable-length commandvCMD, i.e., a command execution timing goes high.

Referring back to FIG. 4, the controller 90 includes a microprocessor(MCU). Upon detection of the uplink signal US by the receiver 71, thecontroller 90 is activated to perform various processing sequences forsending a downlink signal DS to the sensor controller 31 based on thecontent of the variable-length command vCMD supplied from the receiver71. The various processing sequences include a process that acquires apresent pen pressure level from the pen pressure detection sensor 23illustrated in FIG. 1, a process that reads a stylus ID held in anonvolatile memory, not illustrated, a process that changes carrier wavefrequencies, etc.

The transmitter 75 is a circuit that sends a downlink signal DS that isobtained by modulating a carrier wave having a preset frequency andboosting the carrier wave based on the value of the pen pressure levelsupplied from the controller 90, etc. The downlink signal DS is sentthrough the switch circuit SW and radiated from the electrode 21 intospace.

Operation of the sensor controller 31 and the stylus 2 according to thepresent embodiment will be described in detail with reference torespective operation sequences thereof.

FIG. 6 is a flowchart illustrating operation of the sensor controller 31according to the present embodiment. As illustrated in FIG. 6, at atiming to send an uplink signal US, the sensor controller 31 first sendsa preamble Pre (step S1). As described above, the preamble Pre has avalue of “00,” for example. Then, the sensor controller 31 selects one,i.e., a first variable-length command, of a plurality of variable-lengthcommands vCMD each having a variable number of bits, and sends, within afirst frame, the first variable-length command vCMD as an uplink signalUS having a time length commensurate with the number of bits of thefirst variable-length command vCMD (instructing step, step S2).Thereafter, the sensor controller 31 detects or receives a downlinksignal DS sent from the stylus 2 in the rest of the first frame (stepS3), upon which control returns to step S1.

FIG. 7 is a flowchart illustrating operation of the stylus 2 accordingto the present embodiment. As illustrated in FIG. 7, the stylus 2 firstactivates the correlation processor 71 b with a spread code C1 (stepS10). The result of a correlation operation output from the correlationprocessor 71 b thus activated indicates a positive peak value in case aspread code C1 has been received and a negative peak value in case aspread code C1 r has been received, as described above.

The stylus 2 causes the correlation processor 71 b to perform successivecorrelation operations until a preamble Pre is detected (step S11,negative in step S12). The processing of step S11 may be carried outintermittently at a predetermined interval. Providing a preamble Prerepresents “00,” for example, the determined result of step S12 isaffirmative only when two positive peak values are successively detectedat predetermined time intervals, as indicated at times t2, t3 in FIG. 5.

After having detected a preamble Pre (affirmative in step S12), thestylus 2 establishes frame synchronization with the sensor controller 31(synchronizing step, step S13), and then detects an uplink signal US andits time length using the receiver 71 illustrated in FIG. 4 and receivesa variable-length command vCMD within a broken-line frame illustrated inFIG. 7 by continuously decoding the uplink signal US up to the tail ofthe detected time length (receiving step, step S14). Specifically, theprocessing of step S13 represents a process that synchronizes timings toreceive individual spread codes indicating respective bits of thevariable-length command vCMD with the sensor controller 31 based on aframe reference time, described above, acquired by detecting thepreamble Pre. According to this synchronizing process, the stylus 2acquires timings, i.e., sampling timings, at which to cause thecorrelation processor 71 b to perform correlation operations.

In the process for receiving the variable-length command vCMD, thestylus 2 causes the correlation processor 71 b to perform correlationoperations at the sampling timings obtained in step S13 (step S15).According to the example illustrated in FIG. 5, for example, times t4through t8 correspond to sampling timings.

The stylus 2 acquires bit values, which may be of “0” or “1,” based onthe polarity of peak values obtained as a result of the correlationoperations carried out in step S15. The stylus 2 then stores theacquired bit values in a memory, not illustrated, as values of part ofthe variable-length command vCMD (step S16). According to the exampleillustrated in FIG. 5, for example, bit values of “1,” “0,” “0,” “0,”“1” are stored in the memory respectively at times t4 through t8.

Then, based on the bit values acquired so far, the stylus 2 determineswhether a length field has newly been detected or not (step S17). If thestylus 2 determines that a length field has newly been detected, thenthe stylus 2 acquires a bit length of the variable-length command vCMD(step S18), after which control goes back to step S15. On the otherhand, if the stylus 2 determines that a length field has not newly beendetected, then the stylus 2 determines whether the tail of thevariable-length command vCMD is reached or not (step S19). Thisdetermining process is performed based on the bit length of thevariable-length command vCMD acquired in step S18.

If the stylus 2 determines that the tail of the variable-length commandvCMD is not reached in step S19, then control returns to step S15. Onthe other hand, if the stylus 2 determines that the tail of thevariable-length command vCMD is reached in step S19, then the stylus 2acquires the values of a bit train stored in the memory so far as thevalues of the variable-length command vCMD, and executes or interpretsthe acquired bit train as a command (step S20). According to the exampleillustrated in FIG. 5, for example, the timing at which to execute thecommand is a time t8.

Finally, the stylus 2 sends a downlink signal DS according to thevariable-length command vCMD, for example, a downlink signal DSincluding values with respect to data (a pen pressure level, etc.)designated by the variable-length command vCMD at a frequency designatedby the variable-length command vCMD, in the rest of the first framereferred to above, using the controller 90 and the transmitter 75illustrated in FIGS. 3A through 3D (transmitting step, step S21).

According to the present embodiment, as described above, the time lengthof an uplink signal US to be sent by the sensor controller 31 isadjusted depending on the number of bits of a variable-length commandvCMD to be sent. Therefore, it is possible to reduce the proportion ofcommunication resources occupied by uplink signals US sent from thesensor controller 31 to the stylus 2, i.e., an uplink signal occupancyratio, among the communication resources that can be used to send andreceive signals between the stylus 2 and the sensor controller 31.

FIGS. 8A through 8C are diagrams illustrating advantages of the presentembodiment. In FIGS. 8A through 8C, blocks illustrated hatched withlines running up to the right represent periods in which the sensorcontroller 31 sends an uplink signal US, and blocks illustrated hatchedwith lines running down to the right represent periods in which thestylus 2 receives an uplink signal US. In the example illustrated inFIGS. 8A through 8C, times t1 through t3 correspond to a first frame,and times t4 through t6 to a second frame. A period, i.e., times t3through t4, between the frames is used to perform other processes, e.g.,to detect a finger touch, energize a liquid crystal, etc.

FIG. 8A illustrates a diagram illustrating operation of the sensorcontroller 31 and the stylus 2 using conventional fixed-length uplinksignals US according to a comparative example.

The sensor controller 31 sends fixed-length uplink signals US in fixedperiods, i.e., times t1 through t2 and times t4 through t5, positionedat leading ends of respective frames (US Tx), and receives downlinksignals DS in the rest of the frames, i.e., times t2 through t3 andtimes t5 through t6 (DS Rx). The stylus 2 receives the fixed-lengthuplink signals US in the fixed periods, i.e., times t1 through t2 andtimes t4 through t5, positioned at the leading ends of the respectiveframes (US Rx), and sends the downlink signals DS in the rest of theframes, i.e., times t2 through t3 and times t5 through t6 (DS Tx). Sincethe time lengths of the uplink signals US are fixed, if commands to besent are short, the communication resources are consumed wastefully.

FIGS. 8B and 8C illustrate diagrams illustrating operation of the sensorcontroller 31 and the stylus 2 using variable-length uplink signals USaccording to the present embodiment. FIGS. 8B and 8C illustrate ashorter command to be sent in FIG. 8B and a longer command to be sent inFIG. 8C.

According to the present embodiment, as illustrated in FIG. 8B, uplinksignals US are shorter as the command to be sent is shorter. Therefore,it is possible to reduce the uplink signal occupancy ratio. As can beunderstood from a comparison between FIG. 8A and FIG. 8B, it is alsopossible to send uplink signals US more frequently and send downlinksignals DS more frequently for an increased positional detection rate.If a shorter bit string is used as a command to be sent more frequently,then it is possible to reduce the energy that is consumed by the sensorcontroller 31 and the stylus 2 in sending and receiving uplink signalsUS.

Furthermore, according to the present embodiment, as illustrated in FIG.8C, uplink signals US are longer as the command to be sent is longer.Therefore, inasmuch as a longer command can be sent all together, it ispossible to increase the rate of information transmission. Specificexamples of longer commands include commands that are required to sendinformation represented by many bits to the stylus 2 in rather scarcelyoccurring occasions for updating the stylus ID of the stylus 2 andupdating the firmware of the stylus 2.

FIGS. 9A and 9B are diagrams illustrating a variable-length command vCMDaccording to a first modification of the present embodiment. Accordingto the present modification, the variable-length command vCMD includesone or more fields having a predetermined byte length (N bytes in FIGS.9A and 9B). The field or each of the fields has a flag, illustratedhatched, of a 1-bit length, for example, indicating whether there is anext field or not. The flag is used for the stylus 2 to detect the timelength of the uplink signal US, or stated otherwise, the terminal end ofthe variable-length command vCMD.

According to the example illustrated in FIGS. 9A and 9B, a flag of 1indicates that “there are subsequent N bytes (not end),” and a flag of 0indicates that “there are no subsequent N bytes (end).” FIG. 9Aillustrates s that the variable-length command vCMD is of N bytes, i.e.,a first flag is of “0,” and FIG. 9B illustrates that the variable-lengthcommand vCMD is of N×K bytes, i.e., a Kth portion vCMD_(K) of thevariable-length command vCMD is of “0.”

With the variable-length command vCMD according to the presentmodification, the time length of an uplink signal US to be sent by thesensor controller 31 is also adjusted depending on the number of bits ofa variable-length commands vCMD to be sent. Consequently, it is possibleto reduce the uplink signal occupancy ratio.

Of the one or more fields of the variable-length command vCMD, a secondfield to be sent next to a first field may be sent so as to follow thefirst field continuously, or may be sent after elapse of a predeterminedtime from the completion of the sending of the first field. The presentmodification is thus applicable to a situation where the variable-lengthcommand vCMD can be sent continuously in its entirety and also asituation where the variable-length command vCMD has to be sentintermittently, for example, by using a liquid crystal energization idleperiod as a time slot.

FIGS. 10A and 10B are diagrams illustrating a variable-length commandvCMD according to a second modification of the present embodiment. Thevariable-length command vCMD according to the present modification isdifferent from the variable-length command vCMD according to the firstmodification in that the field or each of the fields of thevariable-length command vCMD includes a cyclic redundancy check (CRC)field that includes an error detection value calculated from a bit trainobtained from the value of a bit train included in the field. When thestylus 2 receives the variable-length command vCMD according to thepresent modification, the stylus 2 calculates an error detection valueor values based on a bit train or trains included in the field orfields, compares the error detection value or values with the value orvalues included in the corresponding CRC field or fields, and sends adownlink signal DS if the compared value or values are the same in allthe field or fields.

The present modification is effective to reduce the possibility ofsending a downlink signal DS according to a variable-length command vCMDthat is not correct. Moreover, compared with using a CRC whose length iscommensurate with the data length of variable-length data at the tail ofthe variable-length data, as with CRCs in typical data communication, itis possible to detect errors in respective fields using one CRCdetecting circuit in the stylus 2 without a plurality of logicalcircuits for CRC detection, with the result that the circuit scale ofthe stylus 2 can further be reduced.

FIGS. 11A and 11B are diagrams illustrating a variable-length commandvCMD according to a third modification of the present embodiment.According to the present modification, a special bit sequence or endfield corresponding to a command end value EoC is included. By detectingthis special bit sequence, the stylus 2 detects the time length of anuplink signal US, and ends receiving the variable-length command vCMD.FIG. 11A illustrates that the variable-length command vCMD is of N1bytes, and FIG. 11B illustrates that the variable-length command vCMD isof N2 bytes (N2>N1).

Various data may be considered as specific content of the special bitsequence corresponding to the command end value EoC. According to oneexample, no data may be sent during a time length required to send onespread code C1. Such an example will be described in specific detailbelow.

FIGS. 12A and 12B are diagrams illustrating a method for sending andreceiving variable-length commands vCMD according to the presentmodification. The variable-length commands vCMD illustrated in FIGS. 12Aand 12B are the same as each other except their bit lengths aredifferent from each other.

As illustrated in FIGS. 12A and 12B, the sensor controller 31 accordingto the present modification first sends two “Os” as a preamble Pre(times t1 through t3). The waveform of an uplink signal US during thisperiod represents the waveform of the spread code C1. Then, the sensorcontroller 31 sends a bit train representing specific content of avariable-length command vCMD (times t3 through t4 in FIG. 12A and timest3 through tn in FIG. 12B). The waveform of the uplink signal USrepresents the waveform of the spread code C1 when the transmission bitis of “0,” and represents the waveform of the spread code Clr when thetransmission bit is of “1.” Finally, the sensor controller 31 sends nosignal but stands by during a time length required to send one spreadcode C1 (times t4 through t5 in FIG. 12A and times tn through tn+1 inFIG. 12B.) A command end value EoC is thus sent implicitly.

From the standpoint of the stylus 2, the peak values represented by theresults of correlation operations, which have periodically appearedafter the preamble Pre has been detected, do not appear at the time ofreceiving a command end value EoC. Therefore, the stylus 2 can detect acommand value EoC by not observing the peak values represented by theresults of correlation operations.

FIG. 13 is a flowchart illustrating operation of a sensor controller 31according to the present modification. The operation illustrated in FIG.13 is different from the operation illustrated in FIG. 6 in that astandby time is added between step S2 and step S3. Specifically, afterthe transmission of the variable-length command vCMD has all been ended,the sensor controller 31 sends a command end value EoC by standing byfor a time as long as at least one spread code without sending a spreadcode (standing by step, step S30). Thereafter, the sensor controller 31detects a downlink signal DS sent by the stylus 2 (step S3), after whichcontrol returns to step S1.

FIG. 14 is a flowchart illustrating operation of the stylus 2 accordingto the present modification. The operation illustrated in FIG. 14 isdifferent from the operation illustrated in FIG. 7 in that steps S17through S19 illustrated in FIG. 7 are not provided and a determiningprocess of step S40 is added between step S15 and step S16.Specifically, after having caused the correlation processor 71 b toperform correlation operations in step S15, the stylus 2 determineswhether a peak value has been detected or not (step S40). If the stylus2 determines that a peak value has been detected, then the stylus 2acquires a bit value depending on the polarity of the bit value andstores the acquired bit value in a memory, not illustrated, as a valueof part of the variable-length command vCMD (step S16). According tothis process, for example, a bit value of “1” is stored in the memory ata time t4 in the example illustrated in FIG. 12A. In the exampleillustrated in FIG. 12B, bit values of “1,” “1,” “0,” . . . “1” arestored in the memory respectively at times t4 through tn.

If the stylus 2 determines in step S40 that no peak value has beendetected, then the stylus 2 regards the detection of no peak value asdetecting a command end value EoC and ends receiving the variable-lengthcommand vCMD (reception ending step). The stylus 2 acquires the valuesof a bit train stored in the memory so far as the values of thevariable-length command vCMD, and executes or interprets the acquiredbit train as a command (step S20). The timing at which to execute thecommand is a time t5 in the example illustrated in FIG. 12A. The timingat which to execute the command is a time tn+1 in the exampleillustrated in FIG. 12B. The subsequent process is exactly the same asdescribed above with reference to FIG. 7.

With the variable-length command vCMD according to the presentmodification, the time length of an uplink signal US to be sent by thesensor controller 31 is also adjusted depending on the number of bits ofa variable-length commands vCMD to be sent. Consequently, it is possibleto reduce the uplink signal occupancy ratio.

A second embodiment of the present disclosure will be described below.The present embodiment is based on the third modification of the firstembodiment, but is different therefrom in that different spread codesare used when a preamble Pre (first partial signal) of an uplink signalUS is sent and when a variable-length command vCMD (second partialsignal) thereof is sent, or specifically, a spread code C1 is used whena preamble Pre is sent and a spread code C2 is used when avariable-length command vCMD is sent. Those parts which are identical tothose of the third modification of the first embodiment will hereinafterbe denoted by identical reference characters, and the differences withthe third modification of the first embodiment will be focused on anddescribed below.

FIG. 15 is a diagram illustrating a method for sending and receiving avariable-length command vCMD according to the present embodiment. Asillustrated in FIG. 15, a sensor controller 31 according to the presentembodiment spreads “00” corresponding to a preamble Pre with the directspreader 63 illustrated in FIG. 2, using a 16-chip spread code C1 andsends the spread preamble Pre (times t1 through t3). Then, the sensorcontroller 31 sends a variable-length command vCMD. At this time, thesensor controller 31 spreads a bit train representing thevariable-length command vCMD using a spread code C2 whose code length isshorter than the spread code C1 (times t3 through t5). Specifically, thesensor controller 31 sends “0” of the variable command vCMD with thespread code C2 and sends “1” of the variable command vCMD with a codethat is a reversal of the spread code C2. Finally, the sensor controller31 sends a command end value EoC as with the third modification of thefirst embodiment. In this case, however, the time length of a period inwhich to send a special bit sequence corresponding to a command endvalue EoC, i.e., the time length of a period in which to send no data,may be equal to or longer than a time length required to send one spreadcode C2. Instead of sending a command end value EoC, the length fieldillustrated in the first embodiment or the flag illustrated in the firstmodification of the first embodiment may be sent.

After having detected the preamble Pre using the spread code C1, thestylus 2 acquires the value of the variable-length command vCMD usingthe spread code C2 whose code length is shorter than the spread code C1.As illustrated in FIG. 15, the spread code C1 and the spread code C2have different specific peak values. Consequently, the stylus 2 detectsthe preamble Pre and the variable-length command vCMD with differentpeak values.

FIG. 16 is a flowchart illustrating operation of the stylus 2 accordingto the present embodiment. The processing sequence illustrated in FIG.16 is different from the processing sequence illustrated in FIG. 14 inthat a process (step S41) for activating the correlation processor 71 bwith the spread code C2 is inserted between step S12 and step S13. Bycarrying out step S41, the stylus 2 can detect each of the bits of thevariable-length command vCMD and the command end value EoC based on thespread code C2.

According to the present embodiment, as described above, since the codelength of the spread code used after frame synchronization, i.e., thespread code C2, is shorter than the code length of the spread code usedfor synchronization, i.e., the spread code C1, the uplink signaloccupancy ratio can further be reduced. Though the shorter spread codeleads to a corresponding reduction in noise resistance, since thesampling timing is known after frame synchronization, higher noiseresistance can be achieved than before frame synchronization. Accordingto the present embodiment, therefore, though the spread code used afterframe synchronization is shorter, it is possible to achieve noiseresistance equivalent to that before frame synchronization.

A third embodiment of the present disclosure will be described below.The present embodiment is also based on the third modification of thefirst embodiment, but is different therefrom in that three protocols P1through P3 are selectively used depending on the kind of the sensorcontroller 31 with which the stylus 2 communicates and that spread codesused to send a preamble Pre are common in the protocols whereas spreadcodes used to send a variable-length command vCMD are different fromprotocol to protocol, or specifically, spread codes C1 through C3 areused respectively in the protocols P1 through P3. According to thepresent embodiment, stated otherwise, an uplink signal US is madecompatible with the multiple protocols by selectively using the spreadcodes C1 through C3. Those parts which are identical to those of thethird modification of the first embodiment will hereinafter be denotedby identical reference characters, and the differences with the thirdmodification of the first embodiment will be focused on and describedbelow.

FIG. 17 is a block diagram illustrating functional blocks of the stylus2 according to the present embodiment. As can be understood from acomparison between FIG. 17 and FIG. 4, the stylus 2 according to thepresent embodiment is different from the stylus 2 described according tothe first embodiment in that it has three correlation processors 71 b.As described in detail later, the three correlation processors 71 b areused to perform correlation operations with respective spread codersC31, C32, C33, i.e., spread code variations of the spread code C3, forthe stylus 2 to receive a variable-length command vCMD using the spreadcode C3. The stylus 2 uses only one of the three correlation processors71 b for receiving a variable-length command vCMD using the spread codeC1 or the spread code C2.

Furthermore, the stylus 2 according to the present embodiment operatesin either one of three operation modes corresponding respectively to theprotocols P1 through P3. A present operation mode is set when the userpresses a side switch, not illustrated, on the stylus 2.

FIGS. 18A and 18B are diagrams illustrating the spread code C3. FIG. 18Aillustrates the spread code C1 used for detecting a preamble Pre and thespread code Clr which is a reversal of the spread code C1, as areference for an understanding of the spread code C3. As illustrated inFIG. 18A, the spread code C1 is a 16-chip PN code “0111000010100110” andthe spread code Clr is a PN code “1000111101011001.”

FIG. 18B illustrates spread codes C31, C32, C33, C31 r, C32 r, C33 rthat come under the spread code C3. As illustrated in FIG. 18B, thespread code C31 is identical to the spread code C1. The spread code C32is a spread code obtained by shifting the spread code C31 by five bits.The spread code C33 is a spread code obtained by shifting the spreadcode C32 by five bits. The spread code C31 r is a PN code identical tothe spread code C1 r. The spread code C32 r is a spread code obtained byshifting the spread code C31 r by five bits. The spread code C33 r is aspread code obtained by shifting the spread code C32 r by five bits. Asa consequence, the spread code C31 r is equal to a spread code obtainedby reversing the spread code C31, the spread code C32 r is equal to aspread code obtained by reversing the spread code C32, and the spreadcode C33 r is equal to a spread code obtained by reversing the spreadcode C33. The spread code C3 is thus able to express multiple values bycombining spread codes (three spread codes C31, C32, C33) produced bycyclically shifting the spread code C1 by five bits and spread codes(two positive and negative spread code types) produced by reversing thepolarity of the spread code C1. Specifically, the spread codes C31, C32,C33, C31 r, C32 r, C33 r are associated respectively with 1-bit “0,”2-bit “00,” 2-bit “01,” 1-bit “1,” 2-bit “10,” and 2-bit “11.”

FIGS. 19 and 20 are flowcharts illustrating operation of the stylus 2according to the present embodiment. The processing sequence illustratedin FIGS. 19 and 20 is different from the processing sequence illustratedin FIG. 16 in that a present operation mode of the stylus 2 isdetermined as corresponding to either one of the protocols P1 through P3when a preamble Pre is detected in step S12 (step S42), that step S41 isnot performed if a present operation mode is determined as correspondingto the protocol P1, and that step S43 is performed and step S14 a isperformed instead of step S14 if a present operation mode is determinedas corresponding to the protocol P3.

More specifically, first in step S42, the stylus 2 determines whether apresent operation mode corresponds to either one of the protocols P1through P3 (step S42). For example, the stylus 2 may determine a presentoperation mode by referring to a present operation mode that has beenset by the user.

If the stylus 2 determines a present operation mode as corresponding tothe protocol P1 in step S42, then the stylus 2 continues to use thespread code C1 used to receive the preamble Pre for the reception of avariable-length command vCMD. The operation of the stylus 2 in this caseis the same as the operation of the stylus 2 described above withreference to FIG. 14.

If the stylus 2 determines a present operation mode as corresponding tothe protocol P2 in step S42, then the stylus 2 activates the correlationprocessors 71 b with the spread code C2 that is shorter than the spreadcode C1 (step S41). The operation of the stylus 2 in this case is thesame as the operation of the stylus 2 described above with reference toFIG. 16.

If the stylus 2 determines a present operation mode as corresponding tothe protocol P3 in step S42, then the stylus 2 activates the threecorrelation processors 71 b respectively with the spread codes C31, C32,C33 (step S43), as illustrated in FIG. 20. After having acquired asampling timing in step S13, the stylus 2 receives a variable-lengthcommand vCMD (step S14 a).

The processing of step S14 a is different from the processingillustrated in FIGS. 14 and 16 in that steps S16 a, S40 a are carriedout instead of respective steps S16, S40. Specifically, after the stylus2 has caused the three correlation processors 71 b to perform respectivecorrelation operations at a sampling timing (step S15), the stylus 2determines whether a negative peak of the spread code C31 is detected ornot (step S40 a). If the stylus 2 determines that a negative peak of thespread code C31 is not detected, then since positive or negative peakvalues of the spread codes C32, C33 must be obtained, the stylus 2acquires a 2-bit value depending on the kind of the obtained peakvalues, and stores the acquired bit value in a memory, not illustrated,as a value of part of the variable-length command vCMD (step S16 a). Ifa positive or negative peak value of either one of the spread codes C31,C32, C33 is not obtained, then the stylus 2 may regard the reception ofan uplink signal US as a failure, and may carry out a predeterminederror process.

If the stylus 2 determines that a negative peak of the spread code C31is detected in step S40 a, then the stylus 2 acquires the values of abit train stored in the memory so far as the values of thevariable-length command vCMD, and executes or interprets the acquiredbit train as a command (step S20). Thereafter, control goes back to stepS19 (FIG. 19) in which the stylus 2 sends a downlink signal DS.

FIG. 21 is a diagram illustrating a method for sending and receiving avariable-length command vCMD according to the present embodiment. FIG.21 illustrates that the sensor controller 31 is of the type for sendinga variable-length command vCMD using the spread code C3.

As illustrated in FIG. 21, the sensor controller 31 spreads “00”corresponding to a preamble Pre with the direct spreader 63 illustratedin FIG. 2, using the 16-chip spread code C1 and sends the spreadpreamble Pre (times t1 through t3). Then, the sensor controller 31 sendsa variable-length command vCMD. At this time, the sensor controller 31spreads a bit train representing the variable-length command vCMD usingthe spread codes C32, C33, C32 r, C33 r (times t3 through tn). Since thespread codes C32, C33, C32 r, C33 r can express 2-bit data, as describedabove, the sensor controller 31 sends the data of the variable-lengthcommand vCMD by 2 bits at a time. The stylus 2 receives the spread codesC32, C33, C32 r, C33 r thus sent using the three correlation processors71 b.

Finally, the sensor controller 31 sends the spread code C31 rrepresenting “1.” The spread code C31 r thus sent corresponds to thecommand end value EoC described above. The stylus 2 detects the commandend value EoC by detecting the spread code C31 r, and executes thevariable-length command vCMD represented by the bit train received sofar.

According to the present embodiment, as described above, it is possibleto make the stylus 2 compatible with a plurality of protocols. Inasmuchas one spread code C3 is capable of sending 2-bit data when it is usedto send and receive the variable-length command vCMD, the transmissionrate can be increased by using the spread code C3 compared with usingthe spread code C1. Accordingly, the time length of the uplink signal UScan be reduced.

FIGS. 22A and 22B are diagrams illustrating a method for sending andreceiving variable-length commands vCMD according to a modification ofthe third embodiment of the present disclosure. FIGS. 22A and 22Billustrate that a sensor controller 31 is of the type for sending avariable-length command vCMD using the spread code C3, as with FIG. 21.The method illustrated in FIGS. 22A and 22B is also applicable to asensor controller that is of the type for sending a variable-lengthcommand vCMD using the spread code C1 or C2. The present modification isdifferent from the third embodiment in that information representing thelength of a variable-length command vCMD is included in a preamble Prerather than sending a command end value EoC by sending the spread codeC31 r. The present modification will be described in detail below.

According to the present modification, a plurality of preambles Pre areprepared in advance depending on the lengths of variable-length commandsvCMD. Specifically, a preamble Pre having a value “00” is prepared inassociation with a variable-length command vCMD having a length of 4bits (see FIG. 22A), and a preamble Pre having a value “01” is preparedin association with a variable-length command vCMD having a length of2×(n−2) bits (n is 18, for example) (see FIG. 22B). The sensorcontroller 31 selects the value of a preamble Pre depending on thelength of a variable-length command vCMD to be sent, and sends thepreamble Pre in a stage prior to the variable-length command vCMD. Atthis time, “0” may be sent by using the spread code C1, and “1” may besent by using the spread code Clr. The stylus 2 is thus capable ofselectively receiving a plurality of preambles Pre depending on which ofpositive and negative peak values are represented by the result of acorrelation operation with respect to the spread code C1.

With this arrangement, the stylus 2 is able to recognize the endposition of the variable-length command vCMD without receiving thecommand end value EoC in the example illustrated in FIG. 21.Consequently, there is a possibility that the stylus 2 can execute thevariable-length command vCMD earlier than with the example illustratedin FIG. 21.

According to the third embodiment, information designating a spread codeused to send a variable-length command vCMD may be included in apreamble Pre. The stylus 2 may acquire the value of the information fromthe preamble Pre detected using the spread code C1, determine a spreadcode to be used to detect a variable-length command vCMD from theacquired value, and may, if necessary, switch from the spread code usedby the correlation processors 71 b to the determined spread code. Thesensor controller 31 is thus capable of designating a spread code to beused to receive a variable-length command vCMD.

While the preferred embodiments of the present disclosure have beendescribed above, the present disclosure is not limited to theillustrated embodiments, but may be reduced to practice in various wayswithout departing from the scope thereof.

According to the above embodiments, for example, a variable-lengthcommand vCMD includes a field of a predetermined number of bytes (seeFIGS. 9 and 10). The phrase “predetermined number of bytes” may bereplaced with a phrase “predetermined number of bits” or a phrase“predetermined number of words.” The term “field” may include not onlydata representing one meaning, but also an arbitrary number of data,payload data, a detection code, padding, or a code representing apreamble.

While the preferred embodiments have been described above, it should beunderstood that the embodiments are illustrated by way of example onlyand various many changes and modifications may be made therein withoutdeparting from the scope of the appended claims.

What is claimed is:
 1. A method carried out in a system including anactive stylus and a sensor controller, the method comprising:establishing, by the stylus and the sensor controller, framesynchronization between the sensor controller and the active stylus;selecting, by the sensor controller, a first variable-length commandfrom a plurality of variable-length commands, each of thevariable-length commands including data of a variable number of bits;transmitting, by the sensor controller, the first variable-lengthcommand in a first portion of a first frame using an uplink signalhaving a variable time length that depends on a number of bits of thefirst variable-length command; receiving, by the active stylus, theuplink signal having the variable time length; detecting, by the activestylus, the first variable-length command by decoding the uplink signalhaving the variable time length up to a tail of the uplink signal havingthe variable time length; and transmitting, by the active stylus, adownlink signal that depends on the received first variable-lengthcommand, the downlink signal being transmitted in a second portion ofthe first frame that is different from the first portion of the firstframe.
 2. The method according to claim 1, further comprising:supplying, by the sensor controller, a frame reference time byrepeatedly transmitting the uplink signal in a plurality frames, whereinthe establishing of the frame synchronization includes acquiring, by theactive stylus, the frame reference time by detecting the uplink signal.3. The method according to claim 1, wherein: the first variable-lengthcommand has a length field representing the number of bits of the firstvariable-length command; and the method comprises: determining, by thesensor controller, the number of bits of the first variable-lengthcommand upon selection of the first variable-length command and changingthe value of the length field in the first variable-length command basedon the determined number of bits; and decoding, by the active stylus,the value of the length field in the received first variable-lengthcommand and determining a time period during which to continue receivingthe first variable-length command based on the decoded value of thelength field.
 4. The method according to claim 1, wherein: the firstvariable-length command includes one or more fields each having apredetermined bit length; and each of the one or more fields includes aflag indicating whether there is a next field.
 5. The method accordingto claim 1, wherein: the first variable-length command includes aplurality of fields each having a predetermined bit length; each of theplurality of fields includes a flag indicating whether there is a nextfield and a cyclic redundancy check (CRC) field including an errordetection value calculated from a bit train included in the field; andthe method includes calculating, by the active stylus, a plurality oferror detection values based on a bit train included in each of theplurality of fields of the received first variable-length command, andcomparing each of the calculated error detection values with a valueincluded in a corresponding CRC field of the received firstvariable-length command; and wherein the transmitting of the downlinksignal is in response to determining that each of the calculated errordetection values agrees with the value included in the corresponding CRCfield, for all of the fields of the received first variable-lengthcommand.
 6. The method according to claim 5, wherein: the firstvariable-length command includes at least a first field and a secondfield, the second field following the first field; and the sensorcontroller transmits the second field continuously after thetransmission of first field, or transmits the second field apredetermined time after completion of the of the transmission of thefirst field.
 7. The method according to claim 1, wherein: the firstvariable-length command has an end field indicating a command end at atail of the first variable-length command; the active stylus endsreceiving of the first variable-length command upon detection of the endfield of the first variable-length command.
 8. The method accordingclaim 7, wherein: the method includes, correlating, by the activestylus, a known spread code and the uplink signal; and the active stylusdetects the end field if a peak value is not obtained as a result of thecorrelating of the known spread code and the uplink signal.
 9. Themethod according to claim 8, further comprising: directly spreading, bythe sensor controller, a bit train representing the firstvariable-length command with the known spread code to obtain the uplinksignal; wherein, after the transmitting of the uplink signal, the sensorcontroller does not transmit for a period of time that is at least aslong as a duration of the known spread code; and detecting, by thesensor controller, the downlink signal the period of time that is atleast as long as the duration of the known spread code after thetransmitting of the uplink signal.
 10. A sensor controller comprising: atransmitter which, in operation, establishes frame synchronization withan active stylus, selects a first variable-length command from aplurality of variable-length commands after establishing framesynchronization with the active stylus, each of the variable-lengthcommands including data of a variable number of bits, and transmits thefirst variable-length command in a first portion of a first frame usingan uplink signal having a time length that depends on a number of bitsof the first variable-length command; and a receiver which, inoperation, receives a downlink signal from the active stylus in a secondportion of the first frame that is different from the first portion ofthe first frame, the downlink signal depending on the firstvariable-length command.
 11. An active stylus comprising: a receiverwhich, in operation, establishes frame synchronization with a sensorcontroller, and receives a first variable-length command by detecting anuplink signal transmitted by the sensor controller in a first portion ofa first frame, the first variable-length command being selected from aplurality of variable-length commands, each of the variable-lengthcommands including data of a variable number of bits; and a transmitterwhich, in operation, transmits a downlink signal that depends on thereceived first variable-length command in a second portion of the firstframe that is different from the first portion of the first frame.
 12. Amethod carried out in a system including an active stylus and a sensorcontroller, the method comprising: transmitting, by the secondcontroller, an uplink signal including a first partial signal and asecond partial signal; and receiving, by the active stylus, the uplinksignal; wherein the transmitting includes transmitting the first partialsignal by direct spreading using a first spread code and transmittingthe second partial signal by direct spreading using a second spreadcode, the second spread code being different from the first spread codeand having a chip time length that is identical to a chip time length ofthe first spread code; and wherein the receiving includes, while theactive stylus is synchronized with the uplink signal, detecting thefirst partial signal using the first spread code and subsequentlydetecting the second partial signal using the second spread code. 13.The method according claim 12, wherein: the second spread code has acode length that is shorter than a code length of the first spread code.14. The method according claim 13, wherein: the first spread codeincludes a plurality of the second spread codes.
 15. The methodaccording claim 12, wherein: the first partial signal includesinformation designating the second spread code; and the receivingincludes acquiring a value of the information from the first partialsignal detected using the first spread code, and switching to the secondcode to detect the second partial signal according to the acquiredvalue.
 16. The method according to claim 12, wherein: the second spreadcode used to detect the second partial signal depends on a presentoperation mode of the active stylus.
 17. A system comprising: a sensorcontroller that includes a transmitter which, in operation, transmits anuplink signal including a first partial signal and a second partialsignal, wherein the transmitter transmits the first partial signal bydirect spreading using a first spread code and transmits the secondpartial signal by direct spreading using a second spread code, thesecond spreading code being different from the first spread code andhaving a chip time length that is identical to a chip time length of thefirst spread code; and. an active stylus that includes a receiver which,in operation, receives the uplink signal including the first partialsignal and the second partial signal; wherein the receiver issynchronized with the uplink signal by detecting the first partialsignal using the first spread code and subsequently detecting the secondpartial signal using the second spread code.